const WS_ENTRY_POINT = '/kitchen_monitor';
const WS_NEW_ITEM_TOPIC = '/new_item';
const WS_NEW_PASSON_TOPIC = '/new_passon';
const WS_CANCEL_ITEM_PREPARE_TOPIC = '/cancel_item_prepare';
const WS_CANCEL_ITEM_PASSON_TOPIC = '/cancel_item_passon';
const WS_REFRESH_PREPARE = '/prepare_refresh';
const WS_REFRESH_PASSON = '/passon_refresh';

const STATUS_TO_PREPARE = 1;
const STATUS_TO_PASSON = 2;
const STATUS_PRODUCED = 3;

function completeServerHost(url) {
	let serverHost = window.localStorage.getItem("serverHost");
	if (!serverHost) throw 'Have none server host';
	return `http://${serverHost}${url}`;
}

export default {
		
		WS_ENTRY_POINT,
		
		WS_NEW_ITEM_TOPIC,
		
		WS_NEW_PASSON_TOPIC,
		
		WS_CANCEL_ITEM_PREPARE_TOPIC,
		
		WS_CANCEL_ITEM_PASSON_TOPIC,
		
		WS_REFRESH_PREPARE, 
		
		WS_REFRESH_PASSON,
		
		STATUS_TO_PREPARE,
		
		STATUS_TO_PASSON,
		
		STATUS_PRODUCED,
		
		completeServerHost,


    //获得系统当前店铺ID
    GetShopId: '/v2/auth/shopid', 

    //登录
    AuthLogin: '/v2/auth/{shopId}/login', 
		
		//查询3个分区的订单信息
		GetOrderInfos: '/v2/{shopId}/orders/?needPrepared={needPrepared}',

		//查询订单菜品列表详情
		GetOrderDetail: '/v2/{shopId}/orders/{bsId}',

		//查询订单预定信息
		GetOrderSchedule: '/v2/{shopId}/orders/{bsId}/schedule',

		//保存订单预定信息
		SaveOrderSchedule: '/v2/{shopId}/orders/{bsId}/schedule',

		//查询配菜界面窗口区菜品列表
		GetWindowItems: '/v2/{shopId}/preparation/window?index={index}',

		//查询配菜界面等待区菜品列表
		GetWaitingItems: '/v2/{shopId}/preparation/waiting',

		//保存配菜
		SavePrepareByList: '/v2/{shopId}/preparation/status?kscIds={kscIds}&prepared={prepared}',

		//查询传菜界面成品熟食区菜品列表
		GetCookedItems: '/v2/{shopId}/passon/cooked',

		//查询传菜界面制作区菜品列表
		GetMakingItems: '/v2/{shopId}/passon/making',

		//保存传菜
		SavePasson: '/v2/{shopId}/passon/status?kscIds={kscIds}&passed={passed}',
		
		//取消传菜
		CancelPasson: '/v2/{shopId}/passon/status?kscIds={kscIds}&passed={passed}',

		//保存整单插队
		SaveJumpingOrder: '/v2/{shopId}/orders/{bsId}/jumping',
		
		//保存单品插队
		SaveJumpingItem: '/v2/{shopId}/orders/{bsId}/jumping-items?kscIds={kscIds}',
		
		//查询配菜历史
		GetPrepareHistory: '/v2/{shopId}/histories/preparation?keyword={keyword}',

		//查询传菜历史
		GetPassonHistory: '/v2/{shopId}/histories/passon?keyword={keyword}',

		//查询bi统计数据
		getBizOrderBi: '/v2/{shopId}/biz/order/bi',
};
